/**
 * 
 */
package org.crown.kings.dao;

import java.sql.SQLException;
import java.util.List;

import org.crown.kings.entities.AddressEntity;
import org.crown.kings.entities.InetAddressEntity;
import org.crown.kings.entities.PersonEntity;
import org.crown.kings.entities.PersonSearchResultEntity;

import com.ibatis.sqlmap.client.SqlMapClient;

/**
 * @author nagood
 *
 */
public class PersonSearchResultEntityDAOImpl implements
		PersonSearchResultEntityDAO {
	
    private SqlMapClient sqlMapClient;

	public PersonSearchResultEntityDAOImpl(SqlMapClient sqlMapClient) {
		super();
		this.sqlMapClient = sqlMapClient;
	}

	/* (non-Javadoc)
	 * @see org.crown.kings.dao.PersonSearchResultEntityDAO#selectByExample(org.crown.kings.entities.PersonEntity)
	 */
	@SuppressWarnings("unchecked")
	public List<PersonSearchResultEntity> selectByExample(PersonEntity example) throws SQLException {
		List<PersonSearchResultEntity> list = (List<PersonSearchResultEntity>) sqlMapClient.queryForList("SEARCHRESULTS.findByPersonExample", example);
		return list;
	}

	/* (non-Javadoc)
	 * @see org.crown.kings.dao.PersonSearchResultEntityDAO#selectByExample(org.crown.kings.entities.AddressEntity)
	 */
	@SuppressWarnings("unchecked")
	public List<PersonSearchResultEntity> selectByExample(AddressEntity example) throws SQLException {
		List<PersonSearchResultEntity> list = (List<PersonSearchResultEntity>) sqlMapClient.queryForList("SEARCHRESULTS.findByAddressExample", example);
		return list;
	}

	/* (non-Javadoc)
	 * @see org.crown.kings.dao.PersonSearchResultEntityDAO#selectByExample(org.crown.kings.entities.InetAddressEntity)
	 */
	@SuppressWarnings("unchecked")
	public List<PersonSearchResultEntity> selectByExample(InetAddressEntity example) throws SQLException {
		List<PersonSearchResultEntity> list = (List<PersonSearchResultEntity>) sqlMapClient.queryForList("SEARCHRESULTS.findByInetAddressExample", example);
		return list;
	}

}
